var a = getApp();

Page({
    data: {
        mhei: a.globalData.sheight,
        statusBarHeight: a.globalData.height + "px",
        navigationBarHeight: a.globalData.height + 44 + "px"
    },
    onLoad: function(a) {
        console.log(this.data.mhei);
        // 在页面中定义插屏广告
    let interstitialAd = null

// 在页面onLoad回调事件中创建插屏广告实例
      if (wx.createInterstitialAd) {
        interstitialAd = wx.createInterstitialAd({
          adUnitId: 'adunit-392d3f8bc75d6c51'
        })
        interstitialAd.onLoad(() => {})
        interstitialAd.onError((err) => {})
        interstitialAd.onClose(() => {})
      }

      // 在适合的场景显示插屏广告
      if (interstitialAd) {
        interstitialAd.show().catch((err) => {
          console.error(err)
        })
      }
    },
    goNavapp(){
      wx.navigateToMiniProgram({
        appId: 'wx263a99793509e7d9',
      })
    },
    goMiniProgram: function(a) {
        console.log(a);
        var t = a.currentTarget.dataset.appid;
        wx.navigateToMiniProgram({
            appId: t,
            success: function(a) {
                console.log(a);
            }
        });
    },
    onShareAppMessage: function(a) {
        return "button" === a.from && console.log(a.target), {
            title: "周公解梦 生肖运势",
            path: "/pages/index/index",
            success: function(a) {},
            fail: function(a) {}
        };
    },
    //用户点击右上角分享朋友圈
  onShareTimeline:function(){
    return {
      title:'周公解梦 生肖运势',
      imageUrl:'https://m.xzw.com/static/public/images/tool/vip/43.png'
    }
  }
});